/*
 * @Description: 
 * @Author: baimenghan
 * @Email: baimenghan@nnuo.com
 * @Date: 2022-02-25 09:23:10
 * @LastEditors: baimenghan
 * @LastEditTime: 2022-02-25 14:13:43
 * @FilePath: \daka\src\api\configApi.js
 */

import request from '../request';

// 获取全部配置信息
export const getAllConfigApi = () => {
    return request({
        method: 'get',
        url: '/daka-config/all'
    })
}

// 新增配置
export const addConfigApi = (data) => {
    return request({
        method: 'post',
        url: '/daka-config/add',
        data
    })
}

// 更新配置
export const updateConfigApi = (data) => {
    return request({
        method: 'post',
        url: '/daka-config/update',
        data
    })
}

// 删除配置
export const deleteConfigApi = (data) => {
    return request({
        method: 'post',
        url: '/daka-config/delete',
        params: data
    })
}

// 获取所有需要监控的应用程序
export const getAllApplicationApi = () => {
    return request({
        method: 'get',
        url: '/daka-config/applications'
    })
}

const configApi = {
    getAllConfigApi,
    addConfigApi,
    updateConfigApi,
    deleteConfigApi,
    getAllApplicationApi
}

export default configApi;